/**
 * @author nttdocomo
 */
define(function(require) {
	require("./abstractManager");
	aries.klass("aries.AbstractManager", aries.Class.extend({
		initialize : function(config) {
			config = config || {};

			var me = this, keyFn = config.keyFn;

			me.addEvents(
			/**
			 * @event add
			 * Fires when a new item is added to the hash
			 * @param {Ext.util.HashMap} this.
			 * @param {String} key The key of the added item.
			 * @param {Object} value The value of the added item.
			 */'add',
			/**
			 * @event clear
			 * Fires when the hash is cleared.
			 * @param {Ext.util.HashMap} this.
			 */
			'clear',
			/**
			 * @event remove
			 * Fires when an item is removed from the hash.
			 * @param {Ext.util.HashMap} this.
			 * @param {String} key The key of the removed item.
			 * @param {Object} value The value of the removed item.
			 */
			'remove',
			/**
			 * @event replace
			 * Fires when an item is replaced in the hash.
			 * @param {Ext.util.HashMap} this.
			 * @param {String} key The key of the replaced item.
			 * @param {Object} value The new value for the item.
			 * @param {Object} old The old value for the item.
			 */
			'replace');

			me.mixins.observable.constructor.call(me, config);
			me.clear(true);

			if (keyFn) {
				me.getKey = keyFn;
			}
		}
	}))
})
